<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/9/7
 * Time: 14:20
 */

//创建服务
$http = new Swoole\Http\Server("192.168.182.128", 9501);//"0.0.0.0"

//监听request请求事件
$http->on('request', function ($request, $response) {

    //程序的运行
    var_dump($request->get, $request->post);
    $response->header("Content-Type", "text/html; charset=utf-8");
    $response->end("<h1>Hello Swoole-666. #".rand(1000, 9999)."</h1>");
});

$http->start();